import request from '@/utils/request'

const diy = {
  templateList: '/diy/template-list',
  delTemplate: '/diy/template-del',
  templateEdit: '/diy/template-edit',
  templateSave: '/diy/template-save',
  pageList: '/diy/page-list',
  pageSave: '/diy/page-save',
  pageDel: '/diy/page-del',
  upDown: '/diy/up-down',
  link: '/diy/get-link',
  pintuanCat: 'plugins/pintuan/goods/cat',
  pintuanGoods: 'plugins/pintuan/goods/index',
  getTopicList: '/content/get-topic-list',
  setIndex: '/diy/up-down',
}

export function templateList(parameter) {
  return request({
    url: diy.templateList,
    method: 'get',
    params: parameter,
  })
}

export function delTemplate(parameter) {
  return request({
    url: diy.delTemplate,
    method: 'get',
    params: parameter,
  })
}

export function templateEdit(parameter) {
  return request({
    url: diy.templateEdit,
    method: 'get',
    params: parameter,
  })
}

export function templateSave(parameter) {
  return request({
    url: diy.templateSave,
    method: 'post',
    data: parameter,
  })
}

export function pageList(parameter) {
  return request({
    url: diy.pageList,
    method: 'get',
    params: parameter,
  })
}

export function pageSave(parameter) {
  return request({
    url: diy.pageSave,
    method: 'post',
    data: parameter,
  })
}

export function pageDel(parameter) {
  return request({
    url: diy.pageDel,
    method: 'get',
    params: parameter,
  })
}

export function upDown(parameter) {
  return request({
    url: diy.upDown,
    method: 'get',
    params: parameter,
  })
}

export function link(parameter) {
  return request({
    url: diy.link,
    method: 'get',
    params: parameter,
  })
}

export function pintuanGoods(parameter) {
  return request({
    url: diy.pintuanGoods,
    method: 'get',
    params: parameter,
  })
}

export function pintuanCat(parameter) {
  return request({
    url: diy.pintuanCat,
    method: 'get',
    params: parameter,
  })
}

export function getTopicList(parameter) {
  return request({
    url: diy.getTopicList,
    method: 'get',
    params: parameter,
  })
}

export function setIndex(parameter) {
  return request({
    url: diy.setIndex,
    method: 'get',
    params: parameter,
  })
}
// 获取diy链接接口
export const getLinkGroup = (params) => {
  return request({
    url: '/diy/get-new-link',
    method: 'get',
    params,
  })
}

// 获取diy商城链接接口
export const getLinkGroupShop = (params) => {
  return request({
    url: '/diy/get-link-group',
    method: 'get',
    params,
  })
}

// 获取商品分类数据
export const getCatList = (params) => {
  return request({
    url: '/goods/cat-list',
    method: 'get',
    params,
  })
}

// 连接选择器活动商品列表
export const getActivityGoods = (params) => {
  return request({
    url: '/diy/get-activity-goods',
    method: 'get',
    params,
  })
}

// diy商城分类
export const getStoreCategory = (params) => {
  return request({
    url: '/diy/get-store-category',
    method: 'get',
    params,
  })
}

// diy商城列表
export const getStoreList = (params) => {
  return request({
    url: '/diy/get-store-list',
    method: 'get',
    params,
  })
}
